Repository navigation
remote: client that finds, starts and connects to fizzy - #728
Merged
Merged
Conversation
Client.zig locates fizzy per OS (FIZZY_EXE, the usual install places, Launch Services, App Paths), asks it for its socket (--control-path), starts it with --quiet when nothing listens (macOS: open -g -j) and dials with backoff to a deadline, then upgrades to the remote-view stream and exchanges hellos. Distinct errors: not installed, fizzy too old, add-on too old, timed out, start failed, sandboxed (never a private second fizzy). reconnect runs the same steps after a drop. capi.zig and fizzy_remote.h are the C ABI. Tested against fake_fizzy.zig, an executable on a test socket: found, not found, quiet start, slow start, crash during start, version skew, drop and reconnect. Part of fizzyedit/work#41 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KLaaExP2YTZiSnff98PmgV
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KLaaExP2YTZiSnff98PmgV
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KLaaExP2YTZiSnff98PmgV
A bye closed the stream but left the endpoint, so connected() stayed true and the next poll unwrapped a null stream. connected() now needs the stream, and poll and send finish the close (Closed) when the stream is gone; the endpoint is kept until then because the bye's strings borrow it. New fake mode `bye` and a test polling and sending after a bye. locate now tries the $PATH search (onPath) last, after the fixed places and the system lookup, instead of inside candidates, so a stray fizzy on the path no longer beats the install. A fizzy that startQuiet launched directly (not through open) is now waited for on a detached thread once connected, so its exit leaves no zombie. poll reads the version skew before closing the endpoint it lives in. The bye's borrow is documented on poll and closeAfterBye. connect now reaps a fizzy it started on every exit, a timeout or failed upgrade included (not killed: a slow one may still be found later). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
foxnne
force-pushed
the
sdk/remote-client
branch
from
October 21, 2026 18:59
60bd283 to
9a094aa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of fizzyedit/work#41 (EMBEDDED_EDITOR_PLAN step 5, fizzyedit/work#32)
What changes
sdk/remote/Client.zigis what a host adapter (Blender, Unreal, ...) calls first. It does five things:FIZZY_EXEwins. Otherwise it checks the usual places per OS:/Applicationsand~/Applicationsplus Launch Services on macOS; Velopack under%LOCALAPPDATA%plus App Paths on Windows;~/.local, an AppImage andPATHon Linux.fizzy --control-path, with--profileorFIZZY_PROFILE, unless the host names the socket.--quiet(macOS:open -g -j, never taking focus) and dials with backoff untiltimeout_ms.GET /remoteand exchanges hellos.Errors are distinct:
NotInstalled,NotRunning,FizzyTooOld,ClientTooOld,TimedOut,StartFailedandSandboxed. A sandboxed host that reaches neither the install nor the socket getsSandboxed. A private second fizzy is never started.capi.zigandfizzy_remote.hare the C ABI: open, reconnect, send/recv whole frames, close.The file is
Client.zig, notclient.zigas the kickoff named it, because the lintfile-aliasrule requires a struct file to be TitleCase.build/app.zignow builds the fake fizzy and hands its path to the remote tests through an options module; this replaces the old generic list entry.Over the soft 800-line limit: about 900 lines outside tests and docs. That counts the fake fizzy (about 120 lines) and a mostly-comment header (about 100 lines).
SDK impact
sdk/src/**, no fingerprint move)Verified
Tests run against
fake_fizzy.zig, an executable listening on a test socket. They cover found without a second start, quiet start, not installed / not running / sandboxed, slow start, timeout then found later, crash during start (StartFailed), version skew both ways, and drop then reconnect. The C ABI is tested on top of the same fake.macOS: not tried by hand. The module cross-compiles for aarch64-macos, and
candidatesis tested as strings.mdfindandopen -g -jare untested.Windows: not tried by hand. The module cross-compiles for x86_64-windows.
reg queryoutput parsing is tested; the registry lookup itself is not.Linux: all of these pass:
scripts/check-fmt.shzb build test(35/35 remote tests)test-integrationcheck-webtest-sdk-versionlintcheck-tests-reachedThe remote tests also pass natively with
-lc.Web: not applicable.
check-webpasses.Follow-ups
GET /remote(plan steps 3 and 4) is not here. The tests use the fake.connectthat then failed (TimedOut, failed upgrade) is reaped when it exits but not killed, so it can outlive the failure.Generated by Claude Code